import React from "react";
import './index.css'
import Buttons from "../../components/Buttons";
import FoodList from "../../components/FoodList";
import Turntable from "../../components/Turntable";
import { getLocalFood, initLocalFood, isHasLocalFood } from "../../untils/foodsStorage";

class IndexPage extends React.Component {
  hasFoodsKey = () => {
    if(!isHasLocalFood()){
      initLocalFood()
    }
  }
  componentDidMount(){
    this.hasFoodsKey()
    console.log(getLocalFood())
  }
  render(){
    return(
      <div className="index">
        <Turntable />
        <Buttons />
        <FoodList />
      </div>
    )
  }
}

export default IndexPage